package com.example.wto.viewpagertest01;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * Created by wto on 4/15/2017.
 */

public class UtilSqlHelper extends SQLiteOpenHelper
{

    public UtilSqlHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version)
    {
        super(context, name, factory, version);
    }

    @Override
    public void onCreate(SQLiteDatabase db)
    {
        //创建teacher表
        db.execSQL("create table teacher_table(college_id text,college_name text,s_id text,s_name text,teacher_id text,teacher_name text,primary key(college_id,s_id,teacher_id));");
        db.execSQL("create table week_teacher_table (college_id text,s_id text,teacher_id text,week_name text,order_t text,course_one text,course_two text,course_three  text,course_four  text,course_five  text,course_six  text,primary key(college_id,s_id,teacher_id,week_name))");
        //创建lesson表
        db.execSQL("create table lesson_table (college_id text,college_name text,s_id text,s_name text,lesson_id text,lesson_name text,primary key(college_id,s_id,lesson_id));");
        db.execSQL("create table week_lesson_table (college_id text,s_id text,lesson_id text,week_name text,order_t text,course_one text,course_two text,course_three  text,course_four  text,course_five  text,course_six  text,primary key(college_id,s_id,lesson_id,week_name))");

        //创建教室课表
        db.execSQL("create table class_room_table (college_id text,college_name text,s_id text,s_name text,campus_id text,campus_name text,teach_build_id text,teach_build_name text,class_room_id text,class_room_name text,primary key(college_id,s_id,campus_id,teach_build_id,class_room_id));");
        db.execSQL("create table week_class_room_table (college_id text,s_id text,campus_id text,teach_build_id text,class_room_id text,week_name text,order_t text,course_one text,course_two text,course_three  text,course_four  text,course_five  text,course_six  text,primary key(college_id,s_id,campus_id,teach_build_id,class_room_id,week_name))");


    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
    {

    }
}
